package _07抽象类应用_加油站收银系统;

public class GoldenCard extends Card{
    public GoldenCard() {
    }

    public GoldenCard(String id, Double balance) {
        super(id, balance);
    }

    @Override
    public void pay(Double money) {
        System.out.println("支付成功");
        System.out.println("原价："+money);
        double pay = money * 0.8;
        System.out.println("折扣价："+pay);
        double newBalance = getBalance() - pay;
        System.out.println("余额："+newBalance);

        //新的余额要更新进卡片
        setBalance(newBalance);
    }
}
